//////////////////////////////////////////////////////////////////////////////
//                                                                          //
//     Filename: BaccaratXMLTranslator.h                                    //
//  Create date: February 9, 2006                                           //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////
//                                                                          //
//  Description: This file describes the BaccaratXMLTranslator class.       //
//               This class is a protocol translator that translates from   //
//               the RTG Baccarat protocol to XML and back.                 //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////
//       Copyright (c) 2004 - Realtime Gaming.  All rights reserved.        //
//////////////////////////////////////////////////////////////////////////////

#ifndef __BACCARAT_XML_TRANSLATOR__
#define __BACCARAT_XML_TRANSLATOR__

#include "XMLTranslator.h"

//////////////////////////////////////////////////////////////////////////////
// BJXMLTranslator Class
//////////////////////////////////////////////////////////////////////////////
class BaccaratXMLTranslator : public XMLTranslator
{
public:
    BaccaratXMLTranslator( Server* pServer, Connection* pParent );
    virtual ~BaccaratXMLTranslator();

    // Public Interface
    virtual bool8  TranslateIncomingMessage( uint8* pGameInBuff,  uint32 nGameInBuffSize, uint8* pBuff, uint32 nOutBuffSize );
    virtual uint32 TranslateOutgoingMessage( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize, uint32 nTotalGameBytes );

protected:
	// Internal Helpers
	bool8 AddHandStructure( XMLDoc* pDoc, const String& sParentQuery, uint8* pBuff, uint8& nNumBytesUsed );

	// Incoming
	bool8 TranslateInLogin    ( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInDeal     ( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );

	// Outgoing
	bool8 TranslateOutLogin    ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutError    ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutDeal     ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
};

#endif //#ifndef __BACCARAT_XML_TRANSLATOR__